package org.example.core;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Slf4j
@Component
public class BusRoutesRefreshEventListener implements ApplicationListener<RouteEvent> {

    @Override
    public void onApplicationEvent(RouteEvent routeEvent) {
        Object source = routeEvent.getSource();
        String message = routeEvent.getMessage();
        log.info("接受数据,message:{}", message);
        //具体的业务逻辑
    }
}